% Estimate ratio of pixel changes between two frames
% Arguments:
%   data1 = RGB representation of first frame
%   data2 = RGB representation of second frame
function [changeRatio] = ChangeRatio(data1,data2)
    % Convert data to gray scale
    data1 = rgb2gray(data1);
    data2 = rgb2gray(data2);
    % Calculate differences
    change = data1-data2;
    changeRatio = nnz(change)/(size(change,1)*size(change,2));